//
//  CenterBaseViewController.m
//  BasicDrawerFramework
//
//  Created by lzhr on 14-1-20.
//  Copyright (c) 2014年 lizhongren. All rights reserved.
//

#import "MMDrawerBaseViewController.h"

@interface MMDrawerBaseViewController ()

@end

@implementation MMDrawerBaseViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    if(OSVersionIsAtLeastiOS7()){
        [[NSNotificationCenter defaultCenter]
         addObserver:self
         selector:@selector(contentSizeDidChangeNotification:)
         name:UIContentSizeCategoryDidChangeNotification
         object:nil];
    }
}

- (void)dealloc{
    [[NSNotificationCenter defaultCenter]
     removeObserver:self];
    [super dealloc];
}

-(void)contentSizeDidChangeNotification:(NSNotification*)notification{
    [self contentSizeDidChange:notification.userInfo[UIContentSizeCategoryNewValueKey]];
}

-(void)contentSizeDidChange:(NSString *)size{
    //Implement in subclass
    //子类需要重写这个方法
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
